<template>
	<view>
		<u-navbar :title="shopInfo.name" placeholder autoBack>
			<view class="flexright xiaohui" slot="right" @click="sure(shop_id)">
				<view class="toprightbtn">
					解除綁定
				</view>
			</view>
		</u-navbar>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				shop_id: "",
				shopInfo:{}
			}
		},
		onLoad(options) {
			this.shop_id = options.id
			this.getDetail()
		},
		methods: {
			getDetail() {
				this.http.request("/api/shop/Shopdeail", 'POST', {
					shop_id:this.shop_id
				}).then((res) => {
					this.shopInfo = res.data
				});
			},
			sure(id) {
				httpRequest.modal('提示', '確定解除綁定嗎？', true, (resp) => {
					if (resp) {
						httpRequest.request('/api/shop/fendiandel', 'POST', {
							id: id,
						}).then(res => {
							httpRequest.toast(res.msg)
							if(res.code==1){
								setTimeout(()=>{
									uni.navigateBack(1)
								},100)
							}
						})
					}
				})
			},
		}
	}
</script>

<style>

</style>